<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta 
  name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 遍历
      // function each(arr,callback){
      //   for (let i = 0; i < arr.length; i++) {
      //     console.log(callback(arr[i]));        
      //   }
      // }

      // let arr = [2,3,5,4,8,8]
      // each(arr,item=>{return item})


    // filter
      // function filterFn(arr,callback){
      //   let ary =[]
      //   for (let i = 0; i < arr.length; i++) {
      //      if(callback(arr[i])){
      //       ary.push(arr[i])
      //      }
      //   }
      //   return ary
      // }

      // let arr = [2,3,5,4,8,8]
      // let a = filterFn(arr,item=>{return item%2===0})
      // console.log(a);

  </script>
</body>
</html>